<template>
    <div class="child1">
        <p>子1：{{ toy }}</p>
        <p>书籍：{{ book }} 本</p>
        <button @click="minusHouse($parent)"> 干掉父一套房</button>

    </div>
</template>


<script setup lang="ts" name="Page51sub">
import { ref } from 'vue';
// 数据
let toy = ref('奥特曼');
let book = ref(3)

const minusHouse = (parent: any) => {
    console.log(parent)
    console.log(parent.house)
    parent.house-=1
}


defineExpose({ toy, book })
</script>

<style lang="scss" scoped>
.child1 {
    margin-top: 20px;
    background-color: skyblue;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px black;
}
</style>